package stu.aistar.day03.homework;

/**
 * 十进制转二进制
 */
public class TenToTwo {
    public static void main(String[] args) {
        System.out.println(tenToTwo(12));
    }
    public static String tenToTwo(int i){
        String str = "";
        int temp;
        while (true){
            temp = i%2;
            i = i/2;
            str = temp + str;
            if (i==0){
                break;
            }
        }
        return str;
    }
}
